<!DOCTYPE HTML>
<body>
<script>
function syncXHR() {
  let xhr = new XMLHttpRequest();
  xhr.open("GET", window.location, false);
  xhr.send(null);
}

addEventListener('load', evt => {
  syncXHR();
  document.open();
  document.write(
    '<body>' +
    '<iframe src="about:blank"></iframe>' +
    '<script>window.opener.postMessage("DONE", "*");</' + 'script>' +
    '</body>');
  document.close();
}, { once: true });
</script>
</body>
